import http from "../../axios";

/**
 * 查询部门
 */
export const treeData = (params:any)=>{
    return http.get(`/system/dept/treeDataVue`,params);
}

export const userList = (params:any)=>{
    return http.post(`/system/user/listVue?pageNum=${params.pageNum}&pageSize=${params.pageSize}&userName=${params.userName}&phone=${params.phonenumber}`,params);
}
export const userListTree = (params:any)=>{
    return http.post(`/system/user/listVue?id=${params.id}&pageNum=${params.pageNum}&pageSize=${params.pageSize}`,params);
}
export const deleteUser = (params:any)=>{
    return http.post(`/system/user/removeVue?ids=${params.ids}`,params);
}
export const resetPwdVue = (data:any)=>{
    return http.post(`/system/user/resetPwdVue?loginName=${data.loginName}&password=${data.password}&userId=${data.userId}`,data);
}
export const getDeptAndRole = (data:any)=>{
    return http.post(`/system/user/getDeptAndRole`,data);
}

export const addUserVue = (data:any)=>{
    return http.post(`/system/user/addUserVue`,data);
}

export const updataUserVue = (params:any)=>{
    return http.post(`/system/user/editVue?userId=${params.userId}`,params);
}

export const editUserVue = (data:any)=>{
    return http.post(`/system/user/editUserVue`,data);
}

export const getRoleListVue = (data:any)=>{
    return http.post(`/system/role/listVue`,data);
}

export const deleteRoleById = (parmars:any)=>{
    return http.get(`/system/role/removeRoleListVue?id=${parmars.id}`,parmars);
}

export const addRoleVue = (data:any)=>{
    return http.post(`/system/role/addRoleVue`,data);
}
export const updataVue = (data:any)=>{
    return http.post(`/system/role/updataVue`,data);
}
export const selectOneByRoleId = (parmars:any)=>{
    return http.get(`/system/role/selectOneRole?id=${parmars.id}`,parmars);
}
export const selectMenuListByRoleId = (parmars:any)=>{
    return http.get(`/system/menu/roleMenuTreeDataVue?id=${parmars.id}`,parmars);
}

export const deleteMenuById = (parmars:any)=>{
    return http.get(`/system/menu/remove?menuId=${parmars.menuId}`,parmars);
}

export const selectMenuByMenuId = (parmars:any)=>{
    return http.get(`/system/menu/selectMenuByMenuId?menuId=${parmars.menuId}`,parmars);
}

export const selectMenuEdit = (data:any)=>{
    return http.post(`/system/menu/updataMenu`,data);
}
export const addMenu = (data:any)=>{
    return http.post(`/system/menu/addMenu`,data);
}

export const deleteDeptById = (parmars:any)=>{
    return http.get(`/system/dept/removeDeptVue?deptId=${parmars.deptId}`,parmars);
}

export const getDeptInfoById = (parmars:any)=>{
    return http.get(`/system/dept/getDeptInfoById?deptId=${parmars.deptId}`,parmars);
}
export const updateDeptInfo = (data:any)=>{
    return http.post(`/system/dept/updateDeptInfo`,data);
}
export const addDept = (data:any)=>{
    return http.post(`/system/dept/addDept`,data);
}

export const getPostList = (data:any)=>{
    return http.post(`/system/post/getPostList?pageNum=${data.pageNum}&pageSize=${data.pageSize}&postName=${data.postName}`,data);
}
export const deletePostById = (data:any)=>{
    return http.post(`/system/post/removePostById?id=${data.id}`,data);
}
export const updatePostById = (data:any)=>{
    return http.post(`/system/post/updatePostInfo`,data);
}
export const addNewPost = (data:any)=>{
    return http.post(`/system/post/addPost`,data);
}
export const getPostInfoById = (data:any)=>{
    return http.get(`/system/post/getPostInfoById?postId=${data.postId}`,data);
}
export const resetPwdByUser = (data:any)=>{
    return http.post(`/system/user/profile/resetPwdByUser?oldPassword=${data.oldPassword}&newPassword=${data.newPassword}`,data);
}
export const getAllHospitalInfo = (data:any)=>{
    return http.post(`/sale/selectHospitalInfo?pageNum=${data.pageNum}&pageSize=${data.pageSize}&hospitalName=${data.hosptialName}&hospitalLv=${data.hospitalLv}`,data);
}

export const getConfrimHospitalInfo = (data:any)=>{
    return http.get(`/sale/getConfrimHospitalInfo?pageNum=${data.pageNum}&pageSize=${data.pageSize}`,data);
}
export const getUnConfrimHospitalInfo = (data:any)=>{
    return http.get(`/sale/getUnConfrimHospitalInfo?pageNum=${data.pageNum}&pageSize=${data.pageSize}`,data);
}
